<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.welfare.admin.service.*" %>
<%
	HashList code007	= CommonUtil.getCodeList("007", "");	//행정동
	HashList code009	= CommonUtil.getCodeList("009");	//성별
	HashList code300	= CommonUtil.getCodeList("300");		//상담경로
	HashList code301	= CommonUtil.getCodeList("301");		//상담유형
	HashList code302	= CommonUtil.getCodeList("302");		//상담결과
	HashList code303	= CommonUtil.getCodeList("303", "");	//세대구분
	HashList code304	= CommonUtil.getCodeList("304", "");	//보장구분
	HashList code305	= CommonUtil.getCodeList("305", "");	//분류1
	HashList code306	= CommonUtil.getCodeList("306", "");	//분류2
	HashList code307	= CommonUtil.getCodeList("307", "");	//SMS전송결과
	HashList code309	= CommonUtil.getCodeList("309");		//알림요청
	

	HashList code501	= CommonUtil.getCodeList("501", "");	//생애주기
	HashList code502	= CommonUtil.getCodeList("502", "");	//대상특성
	HashList code503	= CommonUtil.getCodeList("503", "");	//가구유형
	HashList code504	= CommonUtil.getCodeList("504", "");	//소득구분
	HashList code505	= CommonUtil.getCodeList("505", "");	//지원형태
	HashList code506	= CommonUtil.getCodeList("506", "");	//욕구


	
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title><%= SYSTEM_NAME %> 관리자</title>
	<%@ include file="/admin/include/cssnjs.jsp"  %>
	<script type="text/javascript">
	$(document).ready(function() {
		
		$('#counsel_date').mask('9999.99.99').datepicker();
		$('#counsel_date_from').mask('9999.99.99').datepicker();
		$('#counsel_date_to').mask('9999.99.99').datepicker();
		$('#send_date_from').mask('9999.99.99').datepicker();
		$('#send_date_to').mask('9999.99.99').datepicker();
		
		$('#birth_date').numeric();
		$('#tel_no').numeric();
		$('#hp_no').numeric();
		$('#family_count').numeric();
		
		document.customerForm.customer_name.focus();
		
		//이력 탭 클릭
		$('li', '#tabs').click(function(){
		    $('.on', '#tabs').removeClass('on').addClass('off');
		    $(this).addClass('on');
		    
			$('#tabs-counsel:not(.hidden),#tabs-sms:not(.hidden)').addClass('hidden');
			$('#tabs-'+$(this).attr('code')).removeClass('hidden');
		});
		
		//검색 탭 클릭
		$('li', '#tabs2').click(function(){
		    $('.on', '#tabs2').removeClass('on').addClass('off');
		    $(this).addClass('on');
		    
			$('#tabs2-service:not(.hidden),#tabs2-manual:not(.hidden),#tabs2-counsel:not(.hidden),#tabs2-sms:not(.hidden)').addClass('hidden');
			$('#tabs2-'+$(this).attr('code')).removeClass('hidden');
		});
		
		//검색 폼에서 엔터치 조회
		$("#serviceSearchForm, #manualSearchForm, #counselSearchForm, #smsSearchForm").keypress(function(event) {
		    if (event.which == 13) {
		        event.preventDefault();
		        $(this).submit();
		    }
		});
		
		//상담검색 정렬순서 변경
		$('.sort').on('click', function() {

			var sort_col = document.counselSearchForm.sort_col.value;
			var sort_asc = document.counselSearchForm.sort_asc.value;

			if ($(this).attr('id') == sort_col) {

				if (sort_asc == 'asc') {
					document.counselSearchForm.sort_col.value = $(this).attr('id');
					document.counselSearchForm.sort_asc.value = 'desc';
					$(this).addClass("desc");
				} else if (sort_asc == 'desc') {
					document.counselSearchForm.sort_col.value = '';
					document.counselSearchForm.sort_asc.value = '';
					$(this).addClass("sort");
				} else {
					document.counselSearchForm.sort_col.value = $(this).attr('id');
					document.counselSearchForm.sort_asc.value = 'asc';
					$(this).removeClass("sort").addClass("asc");
				}
			}
			else {

				$('.asc, .desc').removeClass().addClass('sort');
	
				document.counselSearchForm.sort_col.value = $(this).attr('id');
				document.counselSearchForm.sort_asc.value = 'asc';
				$(this).removeClass("sort").addClass("asc");
			}
			
			fnSearchCounsel();
		});
		
		//분류1 변경시 해당 분류2 조회
		$('.counsel_kind').on('change', function() {
			cfLoadCounselPart($(this), $(this).closest('td').find('.counsel_part'), '');
		});
		
	});

	
	//고객정보 조회
	function fnSearchCustomer() {
		if (cfCheckRequired(document.customerForm.birth_date)
				|| cfCheckRequired(document.customerForm.tel_no)
				|| cfCheckRequired(document.customerForm.hp_no)
				|| cfCheckRequired(document.customerForm.customer_name)) 
		{
			$.ajax({
				url: './customerSearch.do',
				type: "POST",
			    dataType: 'json',//html,text,json
			    data: { //파라미터
			    	customer_name : document.customerForm.customer_name.value,
			    	birth_date : document.customerForm.birth_date.value,
			    	hp_no : document.customerForm.hp_no.value,
			    	tel_no : document.customerForm.tel_no.value,
			    	sort_col : "customer_name"
			    },
			    error: function(data, status, err){
			    	alert(err);
			    },
				success: function(data){
					if (data.customer_count == 1) {
						setCustomerInfo(data.customer_list[0]);
					} 
					else if (data.customer_count > 1) {
						var obj = cfModal('/admin/call/selectCustomer.jsp?' + $('#customerForm').serialize(), data.customer_list, 600, 400);
						setCustomerInfo(obj);
					} 
					else {
						var srch_customer_name = document.customerForm.customer_name.value;
						document.customerForm.reset();
						document.customerForm.customer_name.value = srch_customer_name;
						document.customerForm.customer_name.select();
					}
			    }
			});
		}
		else {
			alert("검색어를 입력하세요\n\n(이름,생년월일,전화번호,핸드폰번호)");
		}
		
		return false;
	}
	
	//고객정보 설정
	function setCustomerInfo(obj) {
		if (obj != null) {
			document.customerForm.customer_id.value 	= obj.customer_id;
			document.customerForm.customer_name.value 	= obj.customer_name;
			document.customerForm.birth_date.value 		= obj.birth_date;
			if (obj.gender == "M") {
				document.customerForm.gender[0].checked	= true;
			} else if (obj.gender == "F") {
				document.customerForm.gender[1].checked	= true;
			}
			document.customerForm.hp_no.value 			= obj.hp_no;
			document.customerForm.tel_no.value 			= obj.tel_no;
			document.customerForm.dong_code.value 		= obj.dong_code;
			document.customerForm.address.value 		= obj.address;
			document.customerForm.family_gubn.value 	= obj.family_gubn;
			document.customerForm.family_count.value 	= obj.family_count;
			document.customerForm.support_gubn.value 	= obj.support_gubn;
			document.customerForm.tel_agree_yn.checked 	= obj.tel_agree_yn == "Y" ? true : false;
			document.customerForm.sms_agree_yn.checked 	= obj.sms_agree_yn == "Y" ? true : false;
			document.customerForm.remarks.value 		= obj.remarks;
			
			fnSearchCustomerCounsel(obj.customer_id);
			fnSearchCustomerSms(obj.customer_id);
			
			document.customerForm.customer_name.select();	
		}
	}
	
	//고객정보 저장
	function fnSaveCustomer() {
		if (cfCheckRequired(document.customerForm.customer_name, '이름을 입력하세요')
				&& cfCheckDate(document.customerForm.birth_date)
				&& cfCheckRequired(document.customerForm.dong_code, '행정동을 선택하세요')) 
		{
			document.customerForm.job_type.value = (document.customerForm.customer_id.value == "") ? "C" : "U";
			$.ajax({
				url: './customerSave.do',
				type: "POST",
			    dataType: 'json',//html,text,json
			    data: $('#customerForm').serialize(),
			    error: function(data, status, err){
			    	alert(err);
			    },
				success: function(data){
					if (data.result_code == 'SESSION_TIMEOUT') {
						alert("오랜시간 사용하지 않아 로그아웃되었습니다.\n로그인화면으로 이동합니다.");
						top.location.href = "/admin";
					} else {
						document.customerForm.customer_id.value = data.customer_id;
						alert("저장되었습니다.");
					}
			    }
			});
		}
		
		return false;
	}
	
	//고객상담이력 조회
	function fnSearchCustomerCounsel(customerId) {
		if (customerId == undefined) {
			customerId = document.counselForm.customer_id.value;
		}
		$('#customer_counsel_list').load('./include/customerCounselList.jsp?customer_id='+customerId, function() {
			$(this).find('tr').hover(
					function () { $(this).addClass("hover"); }
				  , function () { $(this).removeClass("hover"); }
				)
				.click(function(){
					var counselId = $(this).attr('counsel_id');
					cfOpen('/admin/call/counselInfo.jsp?counsel_id=' + counselId, 'counsel'+$.trim(counselId), 840, 640);
				});
		});
	}
	
	//고객SMS이력 조회
	function fnSearchCustomerSms(customerId) {
		if (customerId == undefined) {
			customerId = document.counselForm.customer_id.value;
		}
		$('#customer_sms_list').load('./include/customerSmsList.jsp?customer_id='+customerId, function() {
			$(this).find('tr').hover(
					function () { $(this).addClass("hover"); }
				  , function () { $(this).removeClass("hover"); }
				)
				.click(function(){
					var smsId = $(this).attr('sms_id');
					cfOpen('/admin/call/smsInfo.jsp?sms_id=' + smsId, 'sms'+$.trim(smsId), 560, 360);
				});
		});
	}
	
	//상담정보 저장
	function fnSaveCounsel() {
		var customerId = document.customerForm.customer_id.value;
		if (customerId == "") {
			alert("고객정보를 조회하세요.");
			return false;
		} else {
			document.counselForm.customer_id.value = customerId;
		}
		
		if (cfCheckRequired(document.counselForm.counsel_path, '상담경로를 선택하세요')
				&& cfCheckRequired(document.counselForm.counsel_date, '상담일자를 입력하세요')
				&& cfCheckRequired(document.counselForm.counsel_type, '상담유형을 선택하세요')
				&& cfCheckRequired(document.counselForm.counsel_kind1, '분류1을 선택하세요')
				&& cfCheckRequired(document.counselForm.counsel_part1, '분류2을 선택하세요')
				&& cfCheckRequired(document.counselForm.service_name, '서비스명을 입력하세요')
				&& cfCheckRequired(document.counselForm.question, '상담질문을 입력하세요')
				&& cfCheckRequired(document.counselForm.counsel_result, '상담결과를 입력하세요')) 
		{
			document.counselForm.job_type.value = "C";	
			$.ajax({
				url: './counselSave.do',
				type: "POST",
			    dataType: 'json',//html,text,json
			    data: $('#counselForm').serialize(),
			    error: function(data, status, err){
			    	alert(err);
			    },
				success: function(data){
					if (data.result_code == 'SESSION_TIMEOUT') {
						alert("오랜시간 사용하지 않아 로그아웃되었습니다.\n로그인화면으로 이동합니다.");
						top.location.href = "/admin";
					} else {
						alert("저장되었습니다.");
						fnSearchCustomerCounsel();
						fnResetCounsel();
					}
			    }
			});
		}
		
		return false;
	}
	
	//자원검색
	function fnSearchService() {
		if (document.serviceSearchForm.excel_yn.value == "Y") {
			return true;
		}
		else {
			$('#tabs2-service div.count').text('검색결과 : searching...');
			$('#service_list').html('');
			$('#service_list').load('./include/serviceList.jsp', $('#serviceSearchForm').serialize(), function() {
				$('#tabs2-service div.count').text('검색결과 : ' + $('#service_list tr').length + '건');
				$(this).find('tr').hover(
						function () { $(this).addClass("hover"); }
					  , function () { $(this).removeClass("hover"); }
					)
					.click(function(){
						var serviceId = $(this).attr('service_id');
						cfOpen('/admin/service/serviceInfo.jsp?service_id=' + serviceId, 'service'+$.trim(serviceId), 1024, 768);
					});
			});
			return false;
		}
	}
	
	

	//업무메뉴얼 검색
	function fnSearchManual() {
		if (document.manualSearchForm.excel_yn.value == "Y") {
			return true;
		}
		else {
			$('#tabs2-manual div.count').text('검색결과 : searching...');
			$('#manual_list').html('');
			$('#manual_list').load('./include/manualList.jsp', $('#manualSearchForm').serialize(), function() {
				$('#tabs2-manual div.count').text('검색결과 : ' + $('#manual_list tr').length + '건');
				$(this).find('tr').hover(
						function () { $(this).addClass("hover"); }
					  , function () { $(this).removeClass("hover"); }
					)
					.click(function(){
						var manualId = $(this).attr('manual_id');
						cfOpen('/admin/call/manualInfo.jsp?manual_id=' + manualId, 'manual'+$.trim(manualId), 800, 620);
					});
			});
			return false;
		}
	}
	
	//업무메뉴얼 등록
	function fnManualNew() {
		cfOpen('/admin/call/manualUpdate.jsp?job_type=C', 'manual_new', 800, 620);
	}
	
	//상담검색
	function fnSearchCounsel() {
		if (document.counselSearchForm.excel_yn.value == "Y") {
			return true;
		}
		else {
			$('#tabs2-counsel div.count').text('검색결과 : searching...');
			$('#counsel_list').html('');
			$('#counsel_list').load('./include/counselList.jsp', $('#counselSearchForm').serialize(), function() {
				$('#tabs2-counsel div.count').text('검색결과 : ' + $('#counsel_list tr').length + '건');
				$(this).find('tr').hover(
						function () { $(this).addClass("hover"); }
					  , function () { $(this).removeClass("hover"); }
					)
					.click(function(){
						var counselId = $(this).attr('counsel_id');
						cfOpen('/admin/call/counselInfo.jsp?counsel_id=' + counselId, 'counsel'+$.trim(counselId), 840, 640);
					});
			});
			return false;
		}
	}
	
	//SMS검색
	function fnSearchSms() {
		if (document.smsSearchForm.excel_yn.value == "Y") {
			return true;
		}
		else {
			$('#tabs2-sms div.count').text('검색결과 : searching...');
			$('#sms_list').html('');
			$('#sms_list').load('./include/smsList.jsp', $('#smsSearchForm').serialize(), function() {
				$('#tabs2-sms div.count').text('검색결과 : ' + $('#sms_list tr').length + '건');
				$(this).find('tr').hover(
						function () { $(this).addClass("hover"); }
					  , function () { $(this).removeClass("hover"); }
					)
					.click(function(){
						var smsId = $(this).attr('sms_id');
						cfOpen('/admin/call/smsInfo.jsp?sms_id=' + smsId, 'sms'+$.trim(smsId), 560, 360);
					});
			});
			return false;
		}
	}
	
	//SMS발송
	function fnOpenSms() {
		cfOpen('/admin/call/smsInfo.jsp?customer_id='+document.customerForm.customer_id.value
				+"&customer_name="+document.customerForm.customer_name.value
				+"&hp_no="+document.customerForm.hp_no.value, 'sms_new', 680, 500);
	}
	
	
	//초기화버튼 클릭
	function fnReset(formName) {
		eval('document.'+formName+'SearchForm').reset();
		$('#'+formName+'_list').html('');
		$('#tabs-'+formName+' div.count').text('검색결과 : 0건');
	}
	
	//엑셀다운버튼 클릭
	function fnExcel(formName) {
		eval('document.'+formName+'SearchForm').excel_yn.value = "Y";
		$('#'+formName+'SearchForm').submit();
		eval('document.'+formName+'SearchForm').excel_yn.value = "N";
	}
	
	
	//팝업에서 삭제한 경우
	function fnCallBackSearch(gubn) {
		switch(gubn) {
			case "RELOAD_COUNSEL_LIST" : 	//상담이력 삭제
				fnSearchCounsel(); 
				break;	
			case "RELOAD_MANUAL_LIST" : 	//내부게시판 삭제
				fnSearchManual(); 
				break;			
		}
	}
	
	function fnResetCustomer() {
		document.customerForm.reset();
		$('#customer_counsel_list').html('');
		$('#customer_sms_list').html('');
	}
	
	function fnResetCounsel() {
		document.counselForm.reset();
		$('option', '.counsel_part').remove();
	}
	</script>
</head>
<body>

<div id="wrap">
	<div id="page">
		<div id="contents_nowidth">
			<div id="callcenter">
				<div id="customer_info">
					<ul  class="tab_01">
					    <li class="on"><p>고객정보</p></li>
					</ul>
					<form id="customerForm" name="customerForm" action="" onsubmit="return fnSearchCustomer()" method="post" >
					<input type="text" class="hidden" name="job_type" value="U"/>
					<input type="text" class="hidden" name="customer_id" value=""/>
					<div class="button">
						<input type="image" class="button" src="../images/btn_search_mini.gif"/>
						<a href="#nohref" onclick="fnSaveCustomer()"><img src="../images/btn_save_mini.gif"/></a> 
						<a href="#nohref" onclick="fnOpenSms()" title="문자발송"><img src="../images/btn_sms_mini.gif"/></a>
						<a href="#nohref" onclick="fnResetCustomer()" title="초기화"><img src="../images/btn_init_mini.gif"/></a>
					</div>
					<table cellpadding="0" cellspacing="0" class="mt5">
						<colgroup>
							<col width="80px"/>
							<col width="120px"/>
							<col width="80px"/>
							<col width="120px"/>
						</colgroup>
						<tbody>
							<tr>
								<th>이름</th>
								<td><input type="text" class="text" name="customer_name" /></td>
								<th>생년월일</th>
								<td><input type="text" class="text" name="birth_date" id="birth_date" maxlength="8" placeholder="YYYYMMDD" /></td>
							</tr>
							<tr>
								<th>전화번호</th>
								<td><input type="text" class="text" name="tel_no" id="tel_no" maxlength="30"/></td>
								<th>핸드폰번호</th>
								<td><input type="text" class="text" name="hp_no" id="hp_no" maxlength="30"/></td>
							</tr>
							<tr>
								<th>행정동</th>
								<td>
									<select name="dong_code">
									<%= StringUtil.makeOption(code007, "") %>
									</select>
								</td>
								<th>성별</th>
								<td><%= StringUtil.makeRadio(code009, "gender", "") %></td>
							</tr>
							<tr>
								<th>주소</th>
								<td colspan="3"><input type="text" class="text w328" name="address" class="w320"/></td>
							</tr>
							<tr>
								<th>세대구분</th>
								<td>
									<select name="family_gubn" >
									<%= StringUtil.makeOption(code303, "") %>
									</select>
								</td>
								<th>가구원수</th>
								<td><input type="text" class="text" name="family_count" id="family_count" maxlength="3"/></td>
							</tr>
							<tr>
								<th>보장구분</th>
								<td>	
									<select name="support_gubn" >
									<%= StringUtil.makeOption(code304, "") %>
									</select>
								</td>
								<th>수신동의</th>
								<td>
									<span class="checkbox"><input type="checkbox" name="tel_agree_yn" id="tel_agree_yn" value="Y"/><label for="tel_agree_yn">전화</label></span>
									<span class="checkbox"><input type="checkbox" name="sms_agree_yn" id="sms_agree_yn" value="Y"/><label for="sms_agree_yn">SMS</label></span>
								</td>
							</tr>
							<tr>
								<th>비고</th>
								<td colspan="3"><input type="text" class="text w328" name="remarks" class="w320"/></td>
							</tr>
						</tbody>
					</table>
					</form>
					
					
					
					
					<div style="position:relative">
					<ul class="tab_01 mt10">
					    <li class="on"><p>상담정보</p></li>
					</ul>
					<form id="counselForm" name="counselForm" action=""  onsubmit="return fnSaveCounsel()" method="post" >
					<input type="text" class="hidden" name="job_type" value="U" />
					<input type="text" class="hidden" name="counsel_id" value=""/>
					<input type="text" class="hidden" name="customer_id" value=""/>
					
					<div class="button">
						<input type="image" class="button" src="../images/btn_save_mini.gif"/>
						<a href="#nohref" onclick="fnResetCounsel()" title="초기화"><img src="../images/btn_init_mini.gif"/></a>
					</div>
					
					<span class="clear"></span>
					
					<table cellpadding="0" cellspacing="0" class="table_05 mt5">
						<colgroup>
							<col width="80px"/>
							<col width="120px"/>
							<col width="80px"/>
							<col width="120px"/>
						</colgroup>
						<tbody>
							<tr>
								<th>상담경로</th>
								<td colspan="3" >
									<%= StringUtil.makeRadio(code300, "counsel_path", "") %>
								</td>
							</tr>
							<tr>
								<th>상담일자</th>
								<td><input type="text" class="text" name="counsel_date" id="counsel_date" value="<%= TODAY %>"/></td>
								<th>상담유형</th>
								<td >
									<%= StringUtil.makeRadio(code301, "counsel_type", "") %>
								</td>
							</tr>
							<tr>
								<th>분류(a)</th>
								<td colspan="3">
									<select name="counsel_kind1" class="counsel_kind">
									<%= StringUtil.makeOption(code305, "") %>
									</select>
									<select name="counsel_part1" class="counsel_part">
									
									</select>
								</td>
							</tr>
							<tr>
								<th>분류(b)</th>
								<td colspan="3">
									<select name="counsel_kind2" class="counsel_kind">
									<%= StringUtil.makeOption(code305, "") %>
									</select>
									<select name="counsel_part2" class="counsel_part">
									
									</select>
								</td>
							</tr>
							<tr>
								<th>분류(c)</th>
								<td colspan="3">
									<select name="counsel_kind3" class="counsel_kind">
									<%= StringUtil.makeOption(code305, "") %>
									</select>
									<select name="counsel_part3" class="counsel_part">
									
									</select>
								</td>
							</tr>
							<tr> 
								<th>서비스명</th>
								<td colspan="3"><input type="text" class="text w328" name="service_name" /></td>
							</tr>
							<tr>
								<th>상담질문</th>
								<td colspan="3" >
									<textarea name="question" rows="5" ></textarea>
								</td>
							</tr>
							<tr>
								<th>상담답변</th>
								<td colspan="3">
									<textarea name="answer" rows="5" ></textarea>
								</td>
							</tr>
							<tr> 
								<th>특이사항</th>
								<td colspan="3">
									<textarea name="note" rows="3" ></textarea>
								</td>
							</tr>
							<tr>
								<th>알림요청</th>
								<td colspan="3">
									<%= StringUtil.makeRadio(code309, "alarm_code", "") %>
								</td>
							</tr>
							<tr>
								<th>상담결과</th>
								<td colspan="3">
									<%= StringUtil.makeRadio(code302, "counsel_result", "") %>
								</td>
							</tr>
						</tbody>
					</table>
					</form>
					</div>
				</div>
				
				
				<div id="customer_history">
					
					<ul id="tabs" class="tab_01">
					    <li class="on" code="counsel" ><p>고객상담이력</p></li>
					    <li class="off" code="sms"><p>고객SMS이력</p></li>
					</ul>
					
					<div id="tabs-counsel" class="mt5">	
						<table width="100%" cellpadding="0" cellspacing="0" class="mt5">
						<colgroup>
								<col width="40px"/>
								<col width="80px"/>
								<col width="60px"/>
								<col width="80px"/>
								<col width="80px"/>
								<col width="80px"/>
								<col />
						</colgroup>
						<thead>
							<tr> 
								<th><p>경로</p></th>
								<th><p>상담일자</p></th>
								<th><p>상담원</p></th>
								<th><p>분류a</p></th>
								<th><p>분류b</p></th> 
								<th><p>분류c</p></th> 
								<th><p>서비스명</p></th>  
							</tr>
						</thead>
						</table>
						
						<div class="box" style="height:188px;">
							<table width="100%" cellpadding="0" cellspacing="0">
							<colgroup>
								<col width="39px"/>
								<col width="80px"/>
								<col width="60px"/>
								<col width="80px"/>
								<col width="80px"/>
								<col width="80px"/>
								<col />
							</colgroup>
							<tbody id="customer_counsel_list">
								
							</tbody>
							</table>
						</div>
					</div>
					
					<div id="tabs-sms" class="mt5 hidden">	
					<table width="100%" cellpadding="0" cellspacing="0" class="mt5">
						<colgroup>
							<col width="150px"/>
							<col width="360px"/>
							<col width="80px"/>
							<col />
						</colgroup>
						<thead>
							<tr> 
								<th><p>수신번호</p></th>
								<th><p>발송내용</p></th>
								<th><p>전송결과</p></th>
								<th><p>전송일자</p></th> 
							</tr>
						</thead>
						</table>
						
						<div class="box" style="height:188px;">
						<table width="100%" cellpadding="0" cellspacing="0">
						<colgroup>
							<col width="149px"/>
							<col width="360px"/>
							<col width="80px"/>
							<col />
						</colgroup>
						<tbody id="customer_sms_list">
					

						</tbody>
						</table>
						</div>
					</div>
				</div>
				
				<div id="counsel_search">
					<ul id="tabs2" class="tab_01">
					    <li class="on"  code="service"><p>자원검색</p></li>
					    <li class="off"  code="manual"><p>내부게시판</p></li>
					    <li class="off"  code="counsel"><p>상담검색</p></li>
					    <li class="off"  code="sms"><p>SMS검색</p></li>
					</ul>
					
					<div id="tabs2-service" class="mt5">	
						<form id="serviceSearchForm" name="serviceSearchForm" method="post" action="./include/serviceExcel.jsp" onsubmit="return fnSearchService()">
						<input type="hidden" name="excel_yn" value="N"/>
						<table width="100%" cellpadding="0" cellspacing="0" class="table mt5">
						<colgroup>
							<col width="80px" />
							<col  />
							<col width="80px" />
							<col  />
							<col width="80px" />
							<col  />
						</colgroup>
						<tr>
							<th>생애주기</th>
							<td>
								<select name="srch_age" class="w80">
								<%= StringUtil.makeOption(code501, "") %>
								</select>
							</td>
							<th>대상특성</th>
							<td>
								<select name="srch_target" >
									<%= StringUtil.makeOption(code502, "") %>
								</select>
							</td>
							<th>가구유형</th>
							<td>
								<select name="srch_family" >
									<%= StringUtil.makeOption(code503, "") %>
								</select>
							</td>
						</tr>
						<tr>
							<th>소득구분</th>
							<td>
								<select name="srch_income" >
									<%= StringUtil.makeOption(code504, "") %>
								</select>
							</td>
							<th>지원형태</th>
							<td>
								<select name="srch_support" >
									<%= StringUtil.makeOption(code505, "") %>
								</select>
							</td>
							<th>욕구</th>
							<td>
								<select name="srch_needs" >
									<%= StringUtil.makeOption(code506, "") %>
								</select>
							</td>
						</tr>
						<tr>
							<th>서비스명</th>
							<td>
								<input type="text" class="text" name="service_name"  />
							</td>
							<th>서비스내용</th>
							<td>
								<input type="text" class="text" name="service_info"  />
							</td>
							<th></th>
							<td>
								
							</td>
						</tr>
						</table>
						
						<div class="count">검색결과 : 0건</div>
						
						<div class="mt5 r">
							<input type="image" class="button" src="../images/btn_search.gif"/>
							<a href="#nohref" onclick="fnReset('service')"><img src="../images/btn_init.gif"/></a>
							<a href="#nohref" onclick="fnExcel('service')"><img src="../images/btn_excel.gif"/></a>
						</div>
			
						</form>
						
					
					
						<table width="100%" cellpadding="0" cellspacing="0" class="mt5">
						<colgroup>
							<col width="100px"/>
							<col width="240px"/>
							<col width="120px"/>
							<col width="100px"/>
							<col width="80px"/>
							<col/>
						</colgroup>
						<thead>
							<tr> 
								<th><p>사업구분</p></th>
								<th><p>서비스명</p></th>
								<th><p>담당부서</p></th>
								<th><p>연락처</p></th>
								<th><p>최종수정일</p></th>
								<th><p>조회</p></th> 
							</tr>
						</thead>
						</table>
						
						<div class="box" style="height:324px;">
						<table width="100%" cellpadding="0" cellspacing="0">
						<colgroup>
							<col width="99px"/>
							<col width="240px"/>
							<col width="120px"/>
							<col width="100px"/>
							<col width="80px"/>
							<col/>
						</colgroup>
						<tbody id="service_list">
					
							
						</tbody>
						</table>
						</div>
						
						
					</div>
					
					<div id="tabs2-manual" class="mt5 hidden">	
						<form id="manualSearchForm" name="manualSearchForm" method="post" action="./include/manualExcel.jsp" onsubmit="return fnSearchManual()">
						<input type="hidden" name="excel_yn" value="N"/>
						<table width="100%" cellpadding="0" cellspacing="0" class="table mt5">
						<colgroup>
							<col width="80px" />
							<col  />
							<col width="80px" />
							<col  />
							<col width="80px" />
							<col  />
						</colgroup>
						<tr>
							<th>분류1</th>
							<td>
								<select name="counsel_kind" class="w80">
								<%= StringUtil.makeOption(code305, "") %>
								</select>
							</td>
							<th>분류2</th>
							<td>
								<select name="counsel_part" >
									<%= StringUtil.makeOption(code306, "") %>
								</select>
							</td>
							<th>제목</th>
							<td>
								<input type="text" name="subject" class="w100" />
							</td>
						</tr>
						</table>
						
						<div class="count">검색결과 : 0건</div>
						
						<div class="mt5 r">
							<input type="image" class="button" src="../images/btn_search.gif"/>
							<a href="#nohref" onclick="fnReset('manual')"><img src="../images/btn_init.gif"/></a>
							<a href="#nohref" onclick="fnManualNew()"><img src="../images/btn_new.gif"/></a>
							<a href="#nohref" onclick="fnExcel('manual')"><img src="../images/btn_excel.gif"/></a>
						</div>
			
						</form>
						
					
					
						<table width="100%" cellpadding="0" cellspacing="0" class="mt5">
						<colgroup>
							<col width="50px"/>
							<col width="100px"/>
							<col width="100px"/>
							<col width="380px"/>
							<col />
						</colgroup>
						<thead>
							<tr> 
								<th><p>공지</p></th>
								<th><p>분류1</p></th>
								<th><p>분류2</p></th>
								<th><p>제목</p></th>
								<th><p>조회</p></th> 
							</tr>
						</thead>
						</table>
						
						<div class="box" style="height:386px;">
						<table width="100%" cellpadding="0" cellspacing="0">
						<colgroup>
							<col width="49px"/>
							<col width="100px"/>
							<col width="100px"/>
							<col width="380px"/>
							<col />
						</colgroup>
						<tbody id="manual_list">
					

						</tbody>
						</table>
						</div>
						
					</div>
					
					<!-- 상담검색 -->
					<div id="tabs2-counsel" class="mt5 hidden">	
						<form id="counselSearchForm" name="counselSearchForm" method="post" action="./include/counselExcel.jsp" onsubmit="return fnSearchCounsel()">
						<input type="hidden" name="excel_yn" value="N"/>
						<input type="hidden" name="sort_col" value=""/>
						<input type="hidden" name="sort_asc" value=""/>
			
						<table width="100%" cellpadding="0" cellspacing="0" class="table mt5">
						<colgroup>
							<col width="80px" />
							<col  />
							<col width="80px" />
							<col width="180px" />
							<col width="80px" />
							<col  />
						</colgroup>
						<tr>
							<th>경로</th>
							<td>
								<select name="counsel_path" class="w80">
								<option value=""></option>
								<%= StringUtil.makeOption(code300, "") %>
								</select>
							</td>
							<th>상담일자</th>
							<td>
								<input type="text" name="counsel_date_from" id="counsel_date_from" class="wdate text" value="<%=TODAY.substring(0,6)+"01"%>"/>
								~
								<input type="text" name="counsel_date_to" id="counsel_date_to" class="wdate text" value="<%=TODAY%>"/>
							</td>
							<th>상담원</th>
							<td>
								<input type="text" class="text" name="reg_user"  />
							</td>
						</tr>
						<tr>
							<th>고객명</th>
							<td>
								<input type="text" class="text" name="customer_name"  />
							</td>
							<th>생년월일</th>
							<td>
								<input type="text" class="text" name="birth_date"  />
							</td>
							<th>핸드폰번호</th>
							<td>
								<input type="text" class="text" name="hp_no" />
							</td>
						</tr>
						<tr>
							<th>분류1</th>
							<td>
								<select name="counsel_kind">
								<%= StringUtil.makeOption(code305, "") %>
								</select>
							</td>
							<th>분류2</th>
							<td>
								<select name="counsel_part" >
									<%= StringUtil.makeOption(code306, "") %>
								</select>
							</td>
							<th>알림요청</th>
							<td>
								<select name="alarm_code" >
									<option value=""></option>
									<%= StringUtil.makeOption(code309, "") %>
								</select>
							</td>
						</tr>
						</table>
						
						<div class="count">검색결과 : 0건</div>
						
						<div class="mt5 r">
							<input type="image" class="button" src="../images/btn_search.gif"/>
							<a href="#nohref" onclick="fnReset('counsel')"><img src="../images/btn_init.gif"/></a>
							<a href="#nohref" onclick="fnExcel('counsel')"><img src="../images/btn_excel.gif"/></a>
						</div>
						</form>
						
					
					
						<table width="100%" cellpadding="0" cellspacing="0" class="mt5">
						<colgroup>
							<col width="40px"/>
							<col width="80px"/>
							<col width="60px"/>
							<col width="70px"/>
							<col width="70px"/>
							<col width="70px"/>
							<col width="160px"/>
							<col width="60px"/>
							<col />
						</colgroup>
						<thead>
							<tr> 
								<th><p>경로</p></th>
								<th><p>상담일시</p></th>
								<th class="sort" id="customer_name"><p>고객명</p></th>
								<th><p>분류a</p></th>
								<th><p>분류b</p></th> 
								<th><p>분류c</p></th> 
								<th class="sort" id="service_name"><p>서비스명</p></th> 
								<th><p>상담원</p></th> 
								<th><p>핸드폰번호</p></th> 
							</tr>
						</thead>
						</table>
						
						
						<div class="box" style="height:324px;">
						<table width="100%" cellpadding="0" cellspacing="0">
						<colgroup>
							<col width="39px"/>
							<col width="80px"/>
							<col width="60px"/>
							<col width="70px"/>
							<col width="70px"/>
							<col width="70px"/>
							<col width="160px"/>
							<col width="60px"/>
							<col />
						</colgroup>
						<tbody id="counsel_list">
					

						</tbody>
						</table>
						</div>
						
					</div>
					
			
			
					<!-- SMS 검색 -->
					<div id="tabs2-sms" class="mt5 hidden">	
						<form id="smsSearchForm" name="smsSearchForm" method="post" action="./include/smsExcel.jsp" onsubmit="return fnSearchSms()">
						<input type="hidden" name="excel_yn" value="N"/>
						<table width="100%" cellpadding="0" cellspacing="0" class="table mt5">
						<colgroup>
							<col width="80px" />
							<col  />
							<col width="80px" />
							<col  />
							<col width="80px" />
							<col width="180px"/>
						</colgroup>
						<tr>
							<th>수신번호</th>
							<td>
								<input type="text" name="dest_info" class="text w100" />
							</td>
							<th>전송결과</th>
							<td>
								<select name="success_yn" >
									<%= StringUtil.makeOption(code307, "") %>
								</select>
							</td>
							<th>전송일자</th>
							<td>
								<input type="text" name="send_date_from" id="send_date_from" class="wdate text" value="<%=TODAY.substring(0,6)+"01"%>"/>
								~
								<input type="text" name="send_date_to" id="send_date_to" class="wdate text" value="<%=TODAY%>"/>
							</td>
						</tr>
						<tr>
							<th>제목</th>
							<td>
								<input type="text" name="subject" class="text w100" />
							</td>
							<th>내용</th>
							<td>
								<input type="text" name="sms_msg" class="text w100" />
							</td>
							<th></th>
							<td>
								
							</td>
						</tr>
						</table>
						
						<div class="count">검색결과 : 0건</div>
						
						<div class="mt5 r">
							<input type="image" class="button" src="../images/btn_search.gif"/>
							<a href="#nohref" onclick="fnReset('sms')"><img src="../images/btn_init.gif"/></a>
							<a href="#nohref" onclick="fnExcel('sms')"><img src="../images/btn_excel.gif"/></a>
						</div>
						</form>
						
					
					
						<table width="100%" cellpadding="0" cellspacing="0" class="mt5">
						<colgroup>
							<col width="150px"/>
							<col width="360px"/>
							<col width="80px"/>
							<col />
						</colgroup>
						<thead>
							<tr> 
								<th><p>수신번호</p></th>
								<th><p>발송내용</p></th>
								<th><p>전송결과</p></th>
								<th><p>전송일자</p></th> 
							</tr>
						</thead>
						</table>
						
						<div class="box" style="height:355px;">
						<table width="100%" cellpadding="0" cellspacing="0">
						<colgroup>
							<col width="149px"/>
							<col width="360px"/>
							<col width="80px"/>
							<col />
						</colgroup>
						<tbody id="sms_list">
					

						</tbody>
						</table>
						</div>
						
					</div>
					
				</div>
			
			
			
			
			</div>
		</div>
	</div>
</div>
</body>
</html>
